﻿#pragma once

#include "Object/Object.h"
#include "EditorNotificationModel.m.h"

class REditorNotificationItemModel;

//通知是放在窗口右下角的一个控件，用于显示一些通知信息，比如正在编译、是否在编译前保存文件等
RCLASS()
class REditorNotificationModel : public RObject
{
    ROBJECT

public:
    void AddItem(TSharedObjectPtr<REditorNotificationItemModel> InItem);
    void RemoveItem(TSharedObjectPtr<REditorNotificationItemModel> InItem);
    void ClearItems();
    bool IsEmpty() const { return Items.Empty(); }
    int64_t GetItemsCount() const { return Items.Num(); }
    TSharedObjectPtr<REditorNotificationItemModel> GetItem(int64_t Index) const { return Items[Index]; }

    TDelegate<void> OnItemsChanged;

protected:
    TVector<TSharedObjectPtr<REditorNotificationItemModel>> Items;

public:
    //通知窗口标题是否可见
    bool IsTitleVisible() const;
    enum class EVisibility
    {
        AllVisible, //所有项可见，包括标题
        LastVisible, //只有最后一项可见,标题不可见
        NoneVisible, //所有项不可见，包括标题
    };
    void ToggleNotificationVisible();
    EVisibility GetVisibility() const { return Visibility; }
    void SetVisibility(EVisibility InVisibility) { Visibility = InVisibility; }
protected:
    EVisibility Visibility = EVisibility::NoneVisible;

public:
    bool IsDontDisturb() { return bDontDisturb ; }
    void ToggleDontDisturb() { bDontDisturb = !bDontDisturb; }
protected:
    //请勿打扰，如果为true，通知窗口将不会自动弹出
    RFIELD()
    bool bDontDisturb = false;

};